import service from '@/utils/request'


export const listColumn = (dataForm: any) => { return service.get('/new/category/getCategoryListByUser', { params: dataForm }) }//栏目管理-分页列表
export const allColumn = (dataForm: any) => { return service.get('/new/category/getCategoriesAll', { params: dataForm }) }//栏目管理-获取全部栏目
export const addPColumn = (dataForm: any) => { return service.post('/new/category/categories/parent', dataForm) }//栏目管理-新增根栏目
export const editPColumn = (dataForm: any) => { return service.put('/new/category/categories/parent/' + dataForm.categoryId, dataForm) }//栏目管理-修改根栏目
export const addSColumn = (dataForm: any) => { return service.post('/new/category/categories/child', dataForm) }//栏目管理-新增子栏目
export const editSColumn = (dataForm: any) => { return service.put('/new/category/child/' + dataForm.categoryId, dataForm) }//栏目管理-修改子栏目
export const deletePColumn = (categoryId: any) => { return service.delete('/new/category/parent/' + categoryId) }//栏目管理-删除父栏目
export const deleteSColumn = (categoryId: any) => { return service.delete('/new/category/child/' + categoryId) }//栏目管理-删除子栏目
export const submitReviewColumn = (dataForm: any) => { return service.post('/agCategoryPermission/review', dataForm) }//栏目管理-提交审核
export const approveColumn = (dataForm: any) => { return service.post('/agCategoryPermission/approve', dataForm) }//栏目管理-审批

export const listLink = (dataForm: any) => { return service.get('/friend-links/page', { params: dataForm }) }//友链-获取分页列表
export const addLink = (dataForm: any) => { return service.post('/friend-links', dataForm) }//友链-新增
export const editLink = (dataForm: any) => { return service.put('/friend-links/' + dataForm.id, dataForm) }//友链-修改
export const deleteLink = (id: any) => { return service.delete('/friend-links/' + id) }//友链-删除



export const selectContent = (dataForm: any) => { return service.get('/content/selectContent', { params: dataForm }) } //分页查询内容列表
export const selectContentLog = (dataForm: any) => { return service.get('/content/selectContentLogs', { params: dataForm }) } //内容日志分页列表
export const saveContent = (dataForm: any) => { return service.post('/content/saveContent', dataForm) } //内容新增保存
export const deleteContent = (dataForm: any) => { return service.post('/content/deleteContent', dataForm) } //内容批量删除
export const check = (dataForm: any) => { return service.post('/new/test/checkNew', dataForm) } //内容管理-文稿审核
export const keywordListContent = (dataForm: any) => { return service.get('/keywordConfig/list', { params: dataForm }) } //内容管理-关键字
//根据内容id获取内容详情
export const getContentDetail = (params: any) => { return service.get(`/content/queryById`,{ params: params }) }
//立即发布撤销
export const promptlyStatus = (params: any) => { return service.post(`/content/updateStatusByContentId`,params) }

export const listNew = (dataForm: any) => { return service.get('/content/selectShowContent', { params: dataForm }) } //新闻配置-外面展示内容列表
export const formListNew = (dataForm: any) => { return service.get('/content/selectNotShowContent', { params: dataForm }) } //新闻配置-弹窗里面分页可选内容列表
export const updateNew = (dataForm: any) => { return service.get('/content/updateShow', { params: dataForm }) } //新闻配置-弹窗修改内容是否展示



// 权限管理  查询接口
export const ColumnPermissions = (dataForm: any) => { return service.get('/agCategoryPermission/getByRoleId', { params: dataForm }) }
// 权限管理  权限新增保存
export const Permissionadd = (dataForm: any) => { return service.post('/agCategoryPermission/createOrUpdate', dataForm) }
export const getAllUser = () => { return service.get('/sys/user/page?page=1&limit=1000') }//栏目权限-获取全部用户
export const authoritySave = (dataForm: any) => { return service.post('/agCategoryPermission/createOrUpdate', dataForm) }//栏目权限-权限分配保存

// 三方 获取列表
export const sangetList = (dataForm: any) => { return service.get('/agThirdParty/getList', { params: dataForm }) }
// 三方  查询详情
export const sanadd = (dataForm: any) => { return service.post('/agThirdParty/get', dataForm) }
// 三方 删除
export const sandelete = (id: any) => { return service.get('/agThirdParty/del' + '?id=' + id) }
// 三方 创建-修改
export const sandedit = (dataForm: any) => { return service.post('/agThirdParty/createOrUpdate', dataForm) }
// 三方 上传
export const sanchuan = (dataForm: any) => { return service.post('/agThirdParty/upload', dataForm) }



export const serachGrey = () => { return service.get('/agColor/selectColor') } //一键变灰-查询
export const saveGrey = (dataForm: any) => { return service.post('/agColor/updateColor', dataForm) } //一键变灰-修改存储

export const getSee = (dataForm: any) => { return service.post('/visitorVolume/getVisitorVolumeByParam', dataForm) } //获取访问量


// 轮播图（大）  
// 获取页面数据
export const carouselList = (dataForm: any) => { return service.get('/carousel/page', { params: dataForm }) }

// 删除
export const carouseldelete = (dataForm: any) => { return service.delete(`/carousel/delete/${dataForm}`) }
// export const carouseldelete = (dataForm: any) => { return service.delete('/carousel/delete', { params: dataForm }) } 



// 轮播图新闻（小）  
// 获取页面数据
export const CarouselNewsList = (dataForm: any) => { return service.get('/industryInnovation/page', { params: dataForm }) }

// 三方 创建-修改
export const CarouselNewdedit = (dataForm: any) => { return service.post('/industryInnovation/saveOrUpdate', dataForm) }

//预览
// export const navigation = () => { return service.get('/new/category/categories/getParents?websiteId=1') }
export const sonColumn = (dataForm: any) => { return service.get(`/new/category/getSubCategories`, { params: dataForm }) }
export const friendLink = () => { return service.get(`/friend-links/selectFriendLink?websiteId=1`) }
export const getContent = (dataForm: any) => { return service.get(`/content/selectContentById`, { params: dataForm }) }
// 关键字配置接口
// 添加关键词配置
export const addKeywordConfig = (data: any) => {
    return service.post('/keywordConfig', data)
}

// 编辑关键词配置
export const editKeywordConfig = (data: any) => {
    return service.put('/keywordConfig', data)
}
export const keywordConfigApi = {
    // 查询单个关键字配置详情
    getById: (id: number) => {
        return service.get(`/keywordConfig/${id}`);
    },

    // 查询全部关键字配置
    getAll: (dataForm: any) => {
        return service.get('/keywordConfig/list', { params: dataForm });
    },

    // 新增关键字配置
    create: (data: { value: string }) => {
        return service.post('/keywordConfig', data);
    },

    // 更新关键字配置
    update: (data: { id: number; value: string }) => {
        return service.put('/keywordConfig', data);
    },

    // 删除关键字配置
    delete: (id: number) => {
        return service.delete(`/keywordConfig/${id}`);
    },
}

//首页配置 获取列表
export const homeConfigList = (dataForm: any) => { return service.get('/homeConfig/list', { params: dataForm }) }
//首页配置 新增
export const homeConfigAdd = (dataForm: any) => { return service.post('/homeConfig/add', dataForm) }
//首页配置 修改
export const homeConfigUpdate = (dataForm: any) => { return service.post('/homeConfig/update', dataForm) }
